//
//  VideoPlayerViewController.h
//  18Birdies
//
//  Created by Lc on 15/8/2.
//  Copyright (c) 2015年 Lc. All rights reserved.
//

#import "BaseViewController.h"

typedef NS_ENUM(NSInteger, VideoPlayerViewControllerMode) {
  VideoPlayerViewControllerModeDefault = 0,
  VideoPlayerViewControllerModeConnectPostNewMessage
};

@class LcVideoPlayer;
@class AVAsset, Practice2;

@interface VideoPlayerViewController : BaseViewController
@property(nonatomic, strong, readonly) NSURL* videoUrl;
@property(nonatomic, assign, readonly) BOOL showOption;
@property(nonatomic, assign, readonly) VideoPlayerViewControllerMode mode;
@property(nonatomic, copy) void (^dismissHandler)(void);
@property(nonatomic, copy) void (^videoPlayerClosedHandler)(void);

@property(nonatomic, assign, readonly) BOOL isPremiumFree;
@property(nonatomic, strong) NSTimer* timer;
@property(nonatomic, assign) double playerPlayingSeconds;

@property(nonatomic, strong, readonly) LcVideoPlayer* originalVideoPlayer;

+ (instancetype)playWithVideoPlayer:(LcVideoPlayer*)player
                 fromViewController:(BaseViewController*)fromViewController;

+ (instancetype)playWithAVAsset:(AVAsset*)avasset
             fromViewController:(BaseViewController*)fromViewController;

+ (void)videoController:(VideoPlayerViewController*)videoController
    pushFromViewController:(BaseViewController*)fromViewController;

- (BOOL)isPlayerPlaying;
- (double)getCurrentSeconds;
- (double)getTotalSeconds;
- (void)closePage;
- (void)refreshPlayButtonIcon;
- (void)refreshTimeUI;
- (void)pause;
- (void)play;
- (void)videoDidFinishPlaying;
- (void)videoReadyForPlaying;
- (void)avPlayerTimeChangesCallBack;
- (void)setPlayButtonHidden:(BOOL)hidden;
- (void)setPlayerBottomActionHidden:(BOOL)hidden;

@end
